﻿@model IEnumerable<ESupervision.Models.MeetingEventParticipant>

@{
    ViewBag.Title = "Meeting Event Participants Management";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="@Url.Content("~/Content/chosen.min.css")" rel="stylesheet" />
<h2>Meeting Event Participants Management</h2>
<div class="row">
    <div class="panel panel-success">
        <div class="panel-heading">
            <h3 class="panel-title" id="panel-title">Meeting request<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
        </div>
        <div class="panel-body">
            @using (Html.BeginForm("MeetingRequest", "MeetingEventParticipant"))
            {
                @Html.AntiForgeryToken()
                @Html.Hidden("EventID", (int)ViewBag.MEventID)
                @Html.ListBox("MeetingRequest", ViewBag.ListOfStudents as MultiSelectList, new { @class = "request-select", data_placeholder = "Choose  Student...", })
                <button type="submit" class="btn btn-success" style="margin-top:20px;text-align:center;"><span class="glyphicon glyphicon-check"> Request</span></button>
            }
        </div>
    </div>
</div>
<div class="row" style="margin-top:20px;">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title" id="panel-title">Requested Meeting<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
        </div>
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table table-hover table-condensed">
                    <thead>
                        <tr>
                            <th>
                                Name of Meeting Event
                            </th>
                            <th>
                                Full name
                            </th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr>
                                <td>
                                    @Html.DisplayFor(modelItem => item.MeetingEvent.Subject)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.RequestedUser.FullName)
                                </td>
                                <td>
                                    @Html.ActionLink("Delete", "Delete", new { id = item.MeetingEventParticipantID })
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<p>
    @Html.ActionLink(" Back to details", "Details", "Meeting", new { id = ViewBag.MEventID }, new { @class = "btn btn-success btn-sm glyphicon glyphicon-repeat" })
</p>
@section scripts {
    <script src="@Url.Content("~/Scripts/chosen.jquery.min.js")" type="text/javascript"></script>
    <script>jQuery(".request-select").chosen({ width: '100%' }); </script>
}

